package com.macro.mall.portal.service;

import com.macro.mall.common.api.CommonPage;
import com.macro.mall.common.api.CommonResult;
import com.macro.mall.model.OmsOrderReturnReason;
import com.macro.mall.portal.domain.OmsOrderReturnApplyDto;
import com.macro.mall.portal.domain.OmsOrderReturnApplyParam;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 前台订单退货管理Service
 * Created by macro on 2018/10/17.
 */
public interface OmsPortalOrderReturnApplyService {
    /**
     * 提交售后申请
     */
    @Transactional
    int create(OmsOrderReturnApplyParam returnApplyParam);

    /**
     * 查询售后单
     */
    CommonResult<CommonPage<OmsOrderReturnApplyDto>> getList(String productName, Integer pageSize, Integer pageNum);

    /**
     * 根据id获取售后单详情
     */
    OmsOrderReturnApplyDto getReturnList(Long id);

    /**
     * 申请换货
     */
    CommonResult exchange(OmsOrderReturnApplyParam orderReturnApplyParam);

    /**
     * 查询换货商品的其他sku信息
     */
    CommonResult getReturnSku(Long orderItemId);

    /**
     * 根据Id撤销退货单
     * @param returnId Id
     * @return
     */
    @Transactional
    CommonResult repealReturnApply(Long returnId);

    /**
     * 获取退货原因
     * @return
     */
    CommonResult<List<OmsOrderReturnReason>> getOmsReturnReason();

}
